package com.aiju.cash.ui.main;

import android.content.Intent;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.aiju.base.activity.BaseTitleActivity;
import com.aiju.cash.R;

/**
 * @author: 流冥
 * @Description: 绑定店铺失败
 */
public class BindFialActivity extends BaseTitleActivity implements View.OnClickListener {
    private Button reBind;
    private TextView linkMan;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bind_fial);
        mAiJuTitleBarView.setCenterTitle("绑定失败");
        reBind = (Button) findViewById(R.id.reBind);
        linkMan = (TextView) findViewById(R.id.linkMan);
        linkMan.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        linkMan.getPaint().setAntiAlias(true);
        reBind.setOnClickListener(this);
        linkMan.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.reBind:
                finish();
                break;
            case R.id.linkMan:
                // TODO: 2017/7/19 联系客服
                call("057189935939");
                break;
        }
    }

    private void call(String phone) {
        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+phone));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }
}
